﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace CustomerUI
{
    /// <summary>
    /// Interaction logic for BookTicketsDetail.xaml
    /// </summary>
    public partial class BookTicketsDetail : Window
    {
        public BookTicketsDetail()
        {
            InitializeComponent();
            MainWindow.schedule.Messenger.Register<TinyCinema.Bussiness.Schedule.Message.BookConfirmation>(this, (s) =>
            {
                s.Result = MessageBoxUtils.WPFMessageBox.Show((App.Current.FindResource("langMsgRUSure") as String), "", MessageBoxButton.YesNo);
            });
            MainWindow.schedule.Messenger.Register<TinyCinema.Bussiness.Schedule.Message.BookConfirmationOK>(this, (s) =>
            {
                this.Close();
                (new CheckBookedTicket()).ShowDialog();
            });
        }

        private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }

        private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            (DataContext as TinyCinema.Bussiness.Schedule.Schedule).CheckCustomerIDCommand.Execute((sender as TextBox).Text);
        }

        private void Cancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            MainWindow.pageDetailUI.blurEffect.Radius = 0;
        }

        private void Back_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            (new SelectDeskDiagram()).ShowDialog();
        }
    }
}
